# Swh0.1 L2 --------------------

en
conf t
vlan 21
name vlan21
end

en
conf t
vlan 31
name vlan31
end

en
conf t
int fa0/1
switchport mode access 
switchport access vlan 21
end

en
conf t
int fa0/2
switchport mode access 
switchport access vlan 31
end

en
conf t
int fa0/3
switchport mode access 
switchport access vlan 21
end

en
conf t
int fa0/4
switchport mode access 
switchport access vlan 31
end

en
conf t
int gi0/1
switchport mode trunk
switchport trunk allowed vlan 21,31
end

wr mem

# Connecorts -----------------

Pc0.1::fa0<->Swh0.1::fa0/1
Pc1.1::fa0<->Swh0.1::fa0/2
Pc2.1::fa0<->Swh0.1::fa0/3
Pc3.1::fa0<->Swh0.1::fa0/4

ip vlan2 192.168.21.1, ip vlan3 192.168.31.1 at Swh0 L3

Pc0.1::: ip address 192.168.21.2 255.255.255.0 gataway 192.168.21.1
Pc1.1::: ip address 192.168.31.2 255.255.255.0 gataway 192.168.31.1
Pc2.1::: ip address 192.168.21.3 255.255.255.0 gataway 192.168.21.1
Pc3.1::: ip address 192.168.31.3 255.255.255.0 gataway 192.168.31.1

# ping 
Pc0.1+Pc2.1
Pc0.1-Pc1.1


# Swh1 L2 --------------------

en
conf t
vlan 21
name vlan21
end

en
conf t
vlan 31
name vlan31
end

en
conf t
int fa0/1
switchport mode access 
switchport access vlan 21
end

en
conf t
int fa0/2
switchport mode access 
switchport access vlan 31
end

en
conf t
int fa0/3
switchport mode access 
switchport access vlan 21
end

en
conf t
int fa0/4
switchport mode access 
switchport access vlan 31
end

en
conf t
int gi0/1
switchport mode trunk
switchport trunk allowed vlan 21,31
end

wr mem

# Connecorts (add one gataway) -----------------

Pc4.1::fa0<->L2::fa0/1
Pc5.1::fa0<->L2::fa0/2
Pc6.1::fa0<->L2::fa0/3
Pc7.1::fa0<->L2::fa0/4


ip vlan2 192.168.21.1, ip vlan3 192.168.31.1 at Swh0 L3

Pc4.1::: ip address 192.168.21.4 255.255.255.0 gataway 192.168.21.1
Pc5.1::: ip address 192.168.31.4 255.255.255.0 gataway 192.168.31.1
Pc6.1::: ip address 192.168.21.5 255.255.255.0 gataway 192.168.21.1
Pc7.1::: ip address 192.168.31.5 255.255.255.0 gataway 192.168.31.1

# ping -----------------
Pc4+Pc6
Pc4-Pc7


# Swh0 L3 (add 1) -------------------

en
conf t
int fa0/1
switchport trunk encapsulation dot1q 
switchport mode trunk
switchport trunk allowed vlan 21,31
end



en
conf t
int fa0/2
switchport trunk encapsulation dot1q 
switchport mode trunk
switchport trunk allowed vlan 21,31
end

en
conf t
int gi0/0
switchport mode access 
switchport access vlan 41
end

en
conf t
vlan 21
name vlan21
end

en
conf t
vlan 31
name vlan31
end

en
conf t
vlan 41
name vlan41
end



en
conf t
int vlan21
ip address 192.168.21.1 255.255.255.0
no shutdown
end

en
conf t
int vlan31
ip address 192.168.31.1 255.255.255.0
no shutdown
end

en
conf t
int vlan41
ip address 192.168.41.2 255.255.255.0
no shutdown
end

en
conf t
ip routing
end

wr mem

# Rut --------------------

en
conf t
int gi0/0
ip address 192.168.41.1 255.255.255.0
no shutdown
end

wr mem

en
ping 192.168.41.2
end
<!-- ping 192.168.2.2  not sccesses - demand STATIC route -->
en
conf t
ip route 192.168.21.0 255.255.255.0 192.168.41.2
ip route 192.168.31.0 255.255.255.0 192.168.41.2

end

wr mem

en
ping 192.168.21.2
ping 192.168.31.2
end

# Connecorts (add 1) -----------------

Swh0.1/L2::gi0/1<->Swh0.1/L3::fa0/1
Swh0.1/L2::gi0/1<->Swh0.1/L3::fa0/2


# ping (add 1) -----------------

Pc0+Pc6
Pc0-Pc5





TMP
en
conf t
no vlan 4
vlan 41
name vlan41
int vlan41
switchport mode access 
switchport access vlan 41
int gi0/0
ip address 192.168.41.1 255.255.255.0
no shutdown
end